package com.apexedu.eas.filter;


import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.apexedu.eas.common.SysContent;


public class GetContent implements Filter {

    public void init(FilterConfig filterConfig) throws ServletException {

    }

    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
    	  SysContent.setRequest((HttpServletRequest)servletRequest);  
          SysContent.setResponse((HttpServletResponse) servletResponse);  
          filterChain.doFilter(servletRequest, servletResponse);  
          SysContent.remove(); //避免发生内存泄漏
    }

    public void destroy() {

    }
}
